//
//  MyViewController.m
//  Againstpoor
//
//  Created by 辰领科技 on 16/11/6.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "MyViewController.h"
#import "AboutViewController.h"

@interface MyViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scroview;
@property (weak, nonatomic) IBOutlet UIButton *headerButton;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@end

@implementation MyViewController

- (void)viewWillAppear:(BOOL)animated {
    if (![[[NSUserDefaults standardUserDefaults]objectForKey:@"one"]isEqualToString:@"1"]) {
        [[NSUserDefaults standardUserDefaults]setObject:@"1" forKey:@"one"];
        _nameLabel.text = @"";
    } else {
        _nameLabel.text = [Common stringFromData:[[NSUserDefaults standardUserDefaults]objectForKey:@"name"]];
    }
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initViewLayout];
}
- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.scroview];
    
    
//    _nameLabel.text = [Common stringFromData:[[NSUserDefaults standardUserDefaults]objectForKey:@"name"]];
}

- (IBAction)back:(id)sender {
    [self backBtn];
}

#pragma mark - 头像
- (IBAction)header:(id)sender {
//    UIStoryboard *secondStroyBoard=[UIStoryboard storyboardWithName:@"LoginStoryboard" bundle:nil];
//    UIViewController *page = [secondStroyBoard instantiateViewControllerWithIdentifier:@"Login"];
//    [[Common getNavigation]pushViewController:page];
}


#pragma mark - 版本更新
- (IBAction)update:(id)sender {
//    [[CWHUDTips sharedInstance]  showTips:@"敬请期待"  withStatus:1 dismissAfter:1.5];
}

#pragma mark - 关于我们
- (IBAction)AboutUs:(id)sender {
    UIStoryboard *secondStroyBoard=[UIStoryboard storyboardWithName:@"HomePageStoryboard" bundle:nil];
    AboutViewController *page = [secondStroyBoard instantiateViewControllerWithIdentifier:@"About"];
    page.type = 1;
    [[Common getNavigation]pushViewController:page];
}

#pragma mark - 修改密码
- (IBAction)ChangeThePassword:(id)sender {
    UIStoryboard *secondStroyBoard=[UIStoryboard storyboardWithName:@"HomePageStoryboard" bundle:nil];
    UIViewController *page = [secondStroyBoard instantiateViewControllerWithIdentifier:@"changePassword"];
    [[Common getNavigation]pushViewController:page];
}

#pragma mark - 退出登录
- (IBAction)Logout:(id)sender {
    [Common DeleteSingleFile];
    [[AppDelegate sharedAppDelegate]ShowLoginPage];
}

@end
